/*
* ============================================================================
* 功能描述 ：GPIO模拟I2C功能lcd屏
* 作者       ：ggls
* 创建日期 ：2024.04.24
* ----------------------------------------------------------------------------
* 更新历史 ：
*	日期 　　- 修改者   : 更新内容描述
*
* ============================================================================
*/

#ifndef __HLY_I2C_H__
#define __HLY_I2C_H__



#define  SCL_OUT_LCD()  	GPIO_ENABLE_OUTPUT(P2TRIS, GPIO_PIN_5)

#define  SCL_IN_LCD()		GPIO_ENABLE_INPUT(P2TRIS, GPIO_PIN_5)

#define  SCL_H_LCD  	P25 = 1

#define  SCL_L_LCD  	P25 = 0

#define  SDA_OUT_LCD()  	GPIO_ENABLE_OUTPUT(P2TRIS, GPIO_PIN_6)

#define  SDA_IN_LCD()		GPIO_ENABLE_INPUT(P2TRIS, GPIO_PIN_6)

#define  SDA_H_LCD  	P26 = 1

#define  SDA_L_LCD  	P26 = 0






void LCD_I2C_Start(void);
void LCD_I2C_Stop(void);
void LCD_read_ACK(void);
void LCD_I2C_init();
void LCD_write_byte(unsigned char date);
unsigned char LCD_read_byte() ;
void LCD_write_add(unsigned char address,unsigned char date) ;
unsigned char LCD_read_add(unsigned char address,char ACK);
void LCD_send_ACK(char ACK);
void LCD_write_MultipleByte(unsigned char address,unsigned char length,unsigned char *date);
void LCD_read_MultipleByte(unsigned char *temp,unsigned char address,unsigned char data_size) ;


#endif /* __DEMO_I2C_H__ */






